typedef struct {
ff_vecs_t *vec;
- char *name;
- char *desc;
+ const char *name;
+ const char *desc;
+ const char *extension;
} vecs_t;
extern ff_vecs_t geo_vecs;
{
&geo_vecs,
"geo",
- "Geocaching.com .loc"
+ "Geocaching.com .loc",
+ "loc"
},
{
&gpsman_vecs,
{
&gpx_vecs,
"gpx",
- "GPX XML"
+ "GPX XML",
+ "gpx"
},
{
&mag_vecs,
{
&pcx_vecs,
"pcx",
- "Garmin PCX5"
+ "Garmin PCX5",
+ "pcx"
},
+#if 0
{
&mapsource_vecs,
"mapsource",
"Garmin Mapsource"
},
+#endif
{
&gpsutil_vecs,
"gpsutil",
{
&dna_vecs,
"dna",
- "Navitrak DNA marker format"
+ "Navitrak DNA marker format",
+ "dna"
},
{
&psp_vecs,
"psp",
- "MS PocketStreets 2002 Pushpin"
+ "MS PocketStreets 2002 Pushpin",
+ "psp"
},
{
&cetus_vecs,
{
&mxf_vecs,
"mxf",
- "MapTech Exchange Format"
+ "MapTech Exchange Format",
+ "mxf"
},
{
&holux_vecs,
"holux",
- "Holux (gm-100) .wpo Format"
+ "Holux (gm-100) .wpo Format",
+ "wpo"
},
{
&ozi_vecs,
"ozi",
- "OziExplorer Waypoint"
+ "OziExplorer Waypoint",
+ "ozi"
},
{
&tpg_vecs,
"tpg",
- "National Geographic Topo .tpg"
+ "National Geographic Topo .tpg",
+ "tpg"
},
{
&tmpro_vecs,
"tmpro",
- "TopoMapPro Places File"
+ "TopoMapPro Places File",
+ "tmpro"
},
{
&gpsdrive_vecs,
return rval;
}
+/*
+ * Display the available formats in a format that's easy for humans to
+ * parse for help on available command line options.
+ */
void
disp_vecs(void)
{
vec->name, vec->desc);
}
}
+
+/*
+ * Display the available formats in a format that's easy to machine
+ * parse. Typically invoked by programs like graphical wrappers to
+ * determine what formats are supported.
+ */
+void
+disp_formats(void)
+{
+ vecs_t *vec;
+ for (vec = vec_list; vec->vec; vec++) {
+ printf("%s\t%s\t%s\n", vec->name,
+ vec->extension? vec->extension : "",
+ vec->desc);
+ }
+}